home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / rmastr02.zip / DEMO5.PAS < prev    next >
Pascal/Delphi Source File  |  1991-09-25  |  1KB  |  41 lines

  1. (* Saving a file from Raster Master as a CON allows you to easily
  2.    included as a part of your executable. All images saved in this
  3.    format will be constants. The file is than inserted in the Const
  4.    part of your program.  Because the PutImage procedure requires
  5.    that the Image be in a pointer, we transfer the address of the
  6.    constant to a pointer. To display the Image use the PutImage
  7.    procedure.
  8.  
  9.    Remarks: Do not try to use the FreeMem function on the pointer
  10.             that the image resides in. Memory is already allocated
  11.             at runtime. Your image resides in the data segment of
  12.             your executable.  Use this method when you have a few
  13.             images. The data segment is limited to 64K. Use the
  14.             method described in Demo6.pas if you require more than
  15.             64K.
  16.  
  17. *)
  18.  
  19. Program Demo5;
  20.  Uses Graph;
  21. Const
  22. {$I PAC.CON}
  23. Var
  24.  Gd   : Integer;
  25.  Gm   : Integer;
  26.  Img  : Pointer;
  27. Begin
  28.  Gd:=EGA;
  29.  Gm:=EGAhi;
  30.  InitGraph(Gd,Gm,'');
  31.  
  32.  Img:=@PacImage;                           (* Pass the Address of the*)
  33.                                            (* PacImage constant to  *)
  34.                                            (* a pointer.             *)
  35.  
  36.  PutImage(300,120,Img^,NormalPut);         (* Display Image *)
  37.  
  38.  ReadLn;                                   (* Wait for Enter Key *)
  39.  
  40.  CloseGraph;                               (* Close graphics *)
  41. End.